package br.mywallet;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import br.mywallet.data.Repositorio;
import br.mywallet.view.ContaListagem;

import com.mywallet.R;

public class MainActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		Repositorio.criarRepositorio(this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	@Override
    public boolean onMenuItemSelected(int id,MenuItem item){
    	Intent it;
    	switch(item.getItemId()){
    	case R.id.menu_conta_listar:
			it = new Intent(this,ContaListagem.class);
			startActivity(it);
			return false;
    	}
    	return false;
    }

}
